#!/bin/bash  
  
# 查找包含关键字 "Sigaction.exe" 的进程的 PID  
get_pid() {  
    ps aux | grep -w "Sigaction.exe" | grep -v grep | awk '{print $2}'  
}  
  
# 发送指定信号给进程  
send_signal() {  
    local pid=$1  
    local signal=$2  
    if [ -n "$pid" ]; then  
        echo "Sending signal $signal to PID $pid"  
        kill -$signal $pid  
    else  
        echo "No process found with keyword 'Sigaction.exe'"  
    fi  
}  
  
# 主逻辑  
signo=2  
while [ $signo -le 5 ]; do  
    pid=$(get_pid)  
    send_signal "$pid" "$signo"  
    sleep 1  # 等待一秒，以便观察进程响应  
    let signo++  
done